<template>
    <a-form-model :label-col="{ span: 4 }" :wrapper-col="{ span: 12 }">
<!--        <a-form-model-item label="店铺LOGO">-->
<!--            <a-upload-->
<!--                list-type="picture-card"-->
<!--                class="avatar-uploader"-->
<!--                :show-upload-list="false"-->
<!--                :action="$api.sellerConfigs+'/upload/images'"-->
<!--                :data="{token:$getSession('token_type'),name:'store_logo'}"-->
<!--                @change="upload"-->
<!--            >-->
<!--                <img v-if="info.store_logo" :src="info.store_logo" />-->
<!--                <div v-else>-->
<!--                    <a-font v-if="!loading" type='iconplus' />-->
<!--                    <a-icon v-else type="loading" />-->
<!--                </div>-->
<!--            </a-upload>-->
<!--        </a-form-model-item>-->
<!--        <a-form-model-item label="店铺LOGO">-->
<!--            <a-upload-->
<!--                list-type="picture-card"-->
<!--                class="avatar-uploader"-->
<!--                :show-upload-list="false"-->
<!--                :action="$api.sellerConfigs+'/upload/images'"-->
<!--                :data="{token:$getSession('token_type'),name:'store_logo'}"-->
<!--                @change="upload"-->
<!--            >-->
<!--                <img v-if="info.store_logo" :src="info.store_logo" />-->
<!--                <div v-else>-->
<!--                    <a-font v-if="!loading" type='iconplus' />-->
<!--                    <a-icon v-else type="loading" />-->
<!--                </div>-->
<!--            </a-upload>-->
<!--        </a-form-model-item>-->
        <a-form-model-item label="企业名称">
            <a-input v-model="info.store_name"></a-input>
        </a-form-model-item>
        <a-form-model-item label="法人代表">
            <a-input placeholder="法人代表" v-model="info.legal_person" :rows="4" />
        </a-form-model-item>
        <a-form-model-item label="注册资本">
            <a-input v-model="info.registered_capital"></a-input>
        </a-form-model-item>
        <a-form-model-item label="详细地址">
            <a-input v-model="info.store_address"></a-input>
        </a-form-model-item>
        <a-form-model-item label="成立日期">
            <a-input v-model="info.date_of_establishment"></a-input>
        </a-form-model-item>
        <a-form-model-item label="联系人">
            <a-input v-model="info.emergency_contact"></a-input>
        </a-form-model-item>
        <a-form-model-item label="邮箱">
            <a-input v-model="info.email"></a-input>
        </a-form-model-item>
        <a-form-model-item label="联系人电话">
            <a-input v-model="info.emergency_contact_phone"></a-input>
        </a-form-model-item>
        <a-form-model-item :wrapper-col="{ span: 12, offset: 4 }">
            <a-button type="primary" @click="handleSubmit">提交</a-button>
        </a-form-model-item>
    </a-form-model>
</template>

<script>
import wangEditor from "@/components/wangeditor"
export default {
    components: {wangEditor},
    props: {},
    data() {
      return {
          info:{},
          loading:false,
      };
    },
    watch: {},
    computed: {},
    methods: {
        handleSubmit(){
            this.info.edit_type = 'base';
            this.$put(this.$api.sellerConfigs,this.info).then(res=>{
                this.get_info();
                return this.$returnInfo(res);
            })
        },
        upload(e){
            if(e.file.status == 'done'){
                this.loading = false;
                let rs = e.file.response;
                if(rs.code == 200){
                    this.$set(this.info,'store_logo',rs.data);
                }else{
                    return this.$message.error(rs.msg);
                }
            }else{
                this.loading = true;
            }

        },
        // 编辑器内容修改
        goods_content_fun(val){
            this.info.after_sale_service = val;
        },
        get_info(){
            this.$get(this.$api.sellerConfigs).then(res=>{
                this.info = res.data;
            })
        }
    },
    created() {
        this.get_info();
    },
    mounted() {}
};
</script>
<style lang="scss" scoped>

</style>
